<template>
	<view class="mass-texting">
		<view class="mass-texting-box">
			<view class="single-line">
				<text class="label">目标行业：</text>
				<text class="right-flex" @click="sk">{{ targetIndustry }}</text>
			</view>
			
			<view class="single-line">
				<text class="label">目标城市：</text>
				<text>{{ region }}</text>
			</view>
			
			<view class="single-line">
				<text class="label">目标号码：</text>
				<text>共计{{ phoneNum }}个</text>
			</view>
			
			<view class="single-line">
				<text class="label">短信内容：</text>
				<view class="right">
					<textarea
						v-model="messageContent" 
						:placeholder="messagePlaceholder"
						placeholder-class="textarea-message"
					/>
					<view class="right-bottom">
						<view class="amount">
							<text>字数：0</text>
							<text>条数：0</text>
						</view>
						<button type="primary" @click="skipTemplate">选择模板</button>
					</view>
				</view>
				
			</view>
			
			<view class="single-line">
				<text class="label">本次发送：</text>
				<radio-group class="radio-group" @change="radioChange">
					<label class="label-item" v-for="(item, index) in items" :key="item.value">
						<radio :value="item.value" :checked="index === current" />
						<text>{{item.name}}</text>
					</label>
				</radio-group>
			</view>
			
			<view class="single-line bule">
				<text class="label">剩余发送条数：{{ remainingNum }}</text>
				<input type="text" value="" />
			</view>
			
			<view class="single-line must-see">
				<text>群发短信必读【点击查看】</text>
			</view>
			<view class="must-read-content">
				{{ mustRead }}
			</view>
			
		</view>
		<view class="a-key-send">一键发送</view>
	</view>
</template>

<script>
	export default {
		//短信群发
		name: "massTexting",
		data() {
			return {
				mustRead: `禁止发送色情、赌博、毒品、党政、维权、众筹、
					慈善募捐、宗教、迷信、股票、移民、保险、房地
					产、教育、培训、面试招聘、博彩、贷款、催款、
					信用卡提现、投资理财、中奖、抽奖、一元夺宝、
					一元秒杀、A货、整形、烟酒、交友、暴力、恐
					吓、色情、皮草、代开发票、代理注册、代办证
					件、加群、加QQ或者加微信、贩卖个人信息、运
					营商策反、流量营销等类型的短信`,
					targetIndustry: '',  //目标行业
					region: '', //目标城市
					phoneNum: 10,
					messageContent: '', //短信内容
					messagePlaceholder: '请先点击右下方按钮选择短信内容模板',
					//单选框的 数组
					items: [
						{
							value: '0',
							name: '全部'
						},{
							value: '1',
							name: '1000',
							checked: 'true'
						},{
							value: '2',
							name: '2000'
						},{
							value: '3',
							name: '5000'
						}
					],
					remainingNum: 0, //剩余条数
					current: 0
			}
		},
		onLoad() {
			//保存 目标行业
			this.targetIndustry = this.$store.state.targetIndustry;
			//保存 目标城市
			this.region = this.$store.state.region;
		},
		methods: {
			radioChange(evt) {
				console.log(evt)
				// for (let i = 0; i < this.items.length; i++) {
				// 	if (this.items[i].value === evt.target.value) {
				// 		this.current = i;
				// 		break;
				// 	}
				// }
			},
			//跳转短信模板 页面
			skipTemplate() {
				uni.navigateTo({
					url: './selectingTemplate'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.mass-texting{
		.mass-texting-box{
			.single-line{
				display: flex;
				align-items: center;
				padding: 30rpx;
				border-bottom: 1px solid #DBDBDB;
				text{
					font-size: 34rpx;
				}
				.right-flex{
					flex: 1;
				}
				.label{
					word-wrap: normal;
					flex-shrink: 0;
					margin-right: 50rpx;
				}
				.textarea-message{
					font-size: 34rpx;
					color: #999999;
				}
				.right{
					flex: 1;
					textarea{
						width: auto;
						display: block;
					}
					.right-bottom{
						display: flex;
						align-items: center;
						.amount{
							text{
								font-size: 30rpx;
								&:first-child{
									margin-right: 30rpx;
								}
							}
						}
						button{
							width: 190rpx;
							height: 60rpx;
							line-height: 60rpx;
							background: #5696F8;
						}
					}
				}
				.radio-group{
					.label-item{
						margin-right: 30rpx;
						radio{
							margin-bottom: 20rpx;
						}
						
					}
				}
				
			}
			.bule{
				color: #5696F8;
			}
			.must-see{
				color: #333333;
				font-weight: 500;
			}
			.must-read-content{
				padding: 30rpx;
				color: #666666;
				line-height: 50rpx;
				font-size: 34rpx;
			}
			
		}
		.a-key-send{
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			color: #ffffff;
			background: #5696F8;
			text-align: center;
			font-size: 36rpx;
		}
	}
</style>
